home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / a_man / cat7 / fsctl.z / fsctl
Encoding:
Text File  |  2002-10-03  |  7.6 KB  |  199 lines

  1.  
  2.  
  3.  
  4. FFFFSSSSCCCCTTTTLLLL((((7777))))                                                              FFFFSSSSCCCCTTTTLLLL((((7777))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      fsctl - operations on a mounted file system
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      /dev/fsctl
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      _f_s_c_t_l presents a device interface for performing low-level operations on
  16.      a mounted file system.  This driver is used by the file system
  17.      reorganizer, _f_s_r.
  18.  
  19.      WARNING: this driver does NOT copy or otherwise operate on data within
  20.      file system blocks.  This can be done through the raw device interface to
  21.      the file system.
  22.  
  23.      Only the superuser can open /_d_e_v/_f_s_c_t_l.  Only one process at a time can
  24.      open this device.
  25.  
  26.      The following operations are available as _i_o_c_t_l(_2) calls on a file
  27.      descriptor opened on this device.  The second argument to _i_o_c_t_l(_2) is the
  28.      command name.  The third argument is a pointer to a _s_t_r_u_c_t _f_s_c_a_r_g with
  29.      the specified fields appropriately set.  The command names and the
  30.      structure are defined in ////uuuussssrrrr////iiiinnnncccclllluuuuddddeeee////ssssyyyyssss////ffffssssccccttttllll....hhhh....
  31.  
  32.      IIIILLLLOOOOCCCCKKKK ddddeeeevvvv iiiinnnnuuuummmm
  33.                Locks the inode, synchronously updates the physical disk with
  34.                the current state of the in-core inode, synchronously updates
  35.                the file's data blocks to disk, and invalidates any cached
  36.                pages for this inode.  This is an inode lock which will cause
  37.                any system call from any process to block until released by an
  38.                IIIIUUUUNNNNLLLLOOOOCCCCKKKK....
  39.  
  40.                [EFAULT]  Failed to copy in argument to _i_o_c_t_l(_2).
  41.  
  42.                [EBUSY]   Another inode is already locked by this device, or
  43.                          the specified inode is in use.
  44.  
  45.                [ENOENT]  The file system was unmounted before the inode could
  46.                          be read from the disk and locked.
  47.  
  48.                [EINVAL]  The device is not a mounted file system, or the inode
  49.                          is not a regular file.
  50.  
  51.                [EFBIG]   Failed to read in indirect extents.
  52.  
  53.      IIIIUUUUNNNNLLLLOOOOCCCCKKKK ddddeeeevvvv iiiinnnnuuuummmm
  54.                Unlocks the inode.
  55.  
  56.                [EFAULT]  Failed to copy in argument to _i_o_c_t_l(_2).
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. FFFFSSSSCCCCTTTTLLLL((((7777))))                                                              FFFFSSSSCCCCTTTTLLLL((((7777))))
  71.  
  72.  
  73.  
  74.                [EINVAL]  The specified inode is not currently IIIILLLLOOOOCCCCKKKK''''eeeedddd....
  75.  
  76.      IIIICCCCOOOOMMMMMMMMIIIITTTT ddddeeeevvvv iiiinnnnuuuummmm nnnneeee eeeexxxx nnnniiii iiiixxxx
  77.                This commits the new direct and indirect extents, and
  78.                synchronously updates the new inode and indirect extents to
  79.                disk.  The state of the inode is otherwise unchanged -- IIIICCCCOOOOMMMMMMMMIIIITTTT
  80.                does not update the inode ctime, or mtime, for example.  nnnneeee is
  81.                the number of direct extents.  eeeexxxx is a pointer to the direct
  82.                extents.  nnnniiiieeee is the number of indirect extents.  iiiixxxx is the
  83.                pointer to the indirect extents.  A check is made that all
  84.                blocks described in the new extent and indirect extents are
  85.                valid and allocated data blocks.  This does NOT copy the
  86.                contents of any data blocks in the implied move as a result of
  87.                IIIICCCCOOOOMMMMMMMMIIIITTTT''''iiiinnnngggg new extents, nor does IIIICCCCOOOOMMMMMMMMIIIITTTT automatically free
  88.                any blocks which are now no longer described by the file's
  89.                extents.  If IIIICCCCOOOOMMMMMMMMIIIITTTT fails for any reason the inode and its
  90.                data remain intact and unchanged.
  91.  
  92.                [EFAULT]  Failed to copy in argument to _i_o_c_t_l(_2).
  93.  
  94.                [EINVAL]  The specified inode is not IIIILLLLOOOOCCCCKKKK''''eeeedddd....
  95.  
  96.                [EINVAL]  The extent information is not valid.  The extent and
  97.                          indirect extent information must be consistent and
  98.                          the blocks they describe must be allocated.
  99.  
  100.                [EFAULT]  Failed to copy in argument to _i_o_c_t_l(_2) or the extent
  101.                          lists to which this points.
  102.  
  103.      BBBBAAAALLLLLLLLOOOOCCCC////BBBBFFFFRRRREEEEEEEE ddddeeeevvvv bbbbnnnn lllleeeennnn
  104.                Allocates/frees the specified blocks.
  105.  
  106.                [EFAULT]  Failed to copy in argument to _i_o_c_t_l(_2).
  107.  
  108.                [EINVAL]  There is currently no IIIILLLLOOOOCCCCKKKK''''eeeedddd inode in the specified
  109.                          device.
  110.  
  111.                [EINVAL]  The specified data blocks are not valid data blocks.
  112.  
  113.                [EEXIST]  The specified data blocks are not currently
  114.                          free/allocated.
  115.  
  116.      TTTTSSSSTTTTAAAALLLLLLLLOOOOCCCC////TTTTSSSSTTTTFFFFRRRREEEEEEEE ddddeeeevvvv bbbbnnnn
  117.                Returns the number of cylinder group data blocks allocated/free
  118.                on the specified dev starting at block bn.
  119.  
  120.                [EFAULT]  Failed to copy in argument to _i_o_c_t_l(_2).
  121.  
  122.                [EINVAL]  There is currently no IIIILLLLOOOOCCCCKKKK''''eeeedddd inode in the specified
  123.                          device.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. FFFFSSSSCCCCTTTTLLLL((((7777))))                                                              FFFFSSSSCCCCTTTTLLLL((((7777))))
  137.  
  138.  
  139.  
  140.                [EINVAL]  The block number is not a valid data block number.
  141.  
  142. RRRREEEEOOOORRRRGGGGAAAANNNNIIIIZZZZEEEERRRR UUUUSSSSAAAAGGGGEEEE
  143.      The reorganizer, _f_s_r, uses /_d_e_v/_f_s_c_t_l as follows:
  144.  
  145.      open(/dev/fsctl)
  146.      for each file system
  147.           for each regular file
  148.                ILOCK
  149.                find better location using TSTFREE/TSTALLOC
  150.                BALLOC new bn+len
  151.                copy blocks to new bn+len using fs device
  152.                ICOMMIT new extents using new bn+len
  153.                BFREE old bn+len
  154.                IUNLOCK
  155.      close(/dev/fsctl)
  156.  
  157.  
  158. FFFFIIIILLLLEEEESSSS
  159.      /usr/include/sys/fsctl.h
  160.  
  161. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  162.      fsr(1M).
  163.  
  164. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  165.      These _i_o_c_t_l(_2)'_s all return -1 on error.  Otherwise, all commands except
  166.      TSTALLOC and TSTFREE return 0.
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.